<?php

    extract(extractPost(), EXTR_PREFIX_ALL, 'u');
    if(isset($u_email)){
        $time = time(getDateWithDelay(0));
        $user = R::findOne('user', ' email = ? ',array($u_email));
        
        if(is_null($user)){
            jsonErrorDie("User email is incorrect. Lock failed.");
        }
        $user->lockTime = $time;
        R::store( $user );
        jsonSuccessDie('message', "Successfully locked user with email $u_email.");
    }
    else{
        jsonErrorDie("Please provide user id.");
    }
    

?>

